package org.alex.samples.model;

import java.io.Serializable;


import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

public class User implements Serializable {
	//属性
	private static final long serialVersionUID=-8694539773273501319L;
	
	@NotNull(message="ID不可以为空！")
	private Integer id;
	
	@NotEmpty(message="姓名不可以为空！")
	@Length(min=1,max=15)
	private String name;
		
	@Range(min=1,max=250,message="只能填写1-250以内的数字")	
	private Integer age;
	
	//有参构造器

	public User(Integer id, String name, Integer age) {
		super();
		this.id = id;
		this.name = name;
		this.age = age;
	}


	public User() {
		super();
	}


	//setter and getter方法
	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}
	
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}


	public void setAge(Integer age) {
		this.age = age;
	}
	
	
	
	
}
